<template>
	<view>
		<view class="dis_f bac_f padding30 bs6 mt36 ml24 mr24" v-for="(item,index) in group_list" :key="index">
			<image class="w180 h180 radius12" :src="item.image" mode="aspectFill"></image>
			<view class="ml24" style="min-width: 438rpx;">
				<view class="fw fz30">
					{{item.name}}
				</view>
				<view class="fz20 fw mt8 radius20 h36 dis_f jc" style="width: 184rpx; background-color: #F7F9FB;">
					<text class="tf_4537">{{item.num}}</text>人拼团，超划算
				</view>
				<view class="dis_flex ac mt16">
					<view class="">
						<view class="dis_f">
							<view class="fz24 fw" style="color: #FE3737;">
								拼团价
							</view>
							<view class="fz36 fw ml12">
								¥{{item.price}}
							</view>
						</view>
						<view class="fz20 tf10">
							<text style="text-decoration:line-through;">原价¥{{item.crossed_price}}</text>
						</view>
					</view>
					<view class="fz24 w156 radius8 tf dis_f jc" style="height: 58rpx; background-image: linear-gradient(#FE877F,#FE2E27);" @click="goGroupDetail(item.id)">
						参与拼团
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { groupBooking } from "@/config/api.js";
	export default {
		data() {
			return {
				group_list:[],
			}
		},
		onLoad() {
			this.getGroupBook()
		},
		methods: {
			//点击参与拼团
			goGroupDetail(id){
				uni.navigateTo({
					url:'../../groupBooking/groupDetail/groupDetail?id='+id
				})
			},
			//获取拼团列表
			getGroupBook(){
				groupBooking().then(res=>{
					console.log(res);
					this.group_list = res
				})
			}
		}
	}
</script>

<style>

</style>
